3.1067 \(\int (a+i a \tan (e+f x)) (c+d \tan (e+f x)) \, dx\)

Optimal. Leaf size=46 \[ -\frac{a (d+i c) \log (\cos (e+f x))}{f}+a x (c-i d)+\frac{i a d \tan (e+f x)}{f} \]

[Out]

a*(c - I*d)*x - (a*(I*c + d)*Log[Cos[e + f*x]])/f + (I*a*d*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0296109, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3525, 3475} \[ -\frac{a (d+i c) \log (\cos (e+f x))}{f}+a x (c-i d)+\frac{i a d \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x]),x]

[Out]

a*(c - I*d)*x - (a*(I*c + d)*Log[Cos[e + f*x]])/f + (I*a*d*Tan[e + f*x])/f

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+i a \tan (e+f x)) (c+d \tan (e+f x)) \, dx &=a (c-i d) x+\frac{i a d \tan (e+f x)}{f}+(a (i c+d)) \int \tan (e+f x) \, dx\\ &=a (c-i d) x-\frac{a (i c+d) \log (\cos (e+f x))}{f}+\frac{i a d \tan (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0332174, size = 66, normalized size = 1.43 \[ -\frac{i a c \log (\cos (e+f x))}{f}+a c x-\frac{i a d \tan ^{-1}(\tan (e+f x))}{f}+\frac{i a d \tan (e+f x)}{f}-\frac{a d \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x]),x]

[Out]

a*c*x - (I*a*d*ArcTan[Tan[e + f*x]])/f - (I*a*c*Log[Cos[e + f*x]])/f - (a*d*Log[Cos[e + f*x]])/f + (I*a*d*Tan[
e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 81, normalized size = 1.8 \begin{align*}{\frac{iad\tan \left ( fx+e \right ) }{f}}+{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) c}{f}}+{\frac{a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) d}{2\,f}}-{\frac{ia\arctan \left ( \tan \left ( fx+e \right ) \right ) d}{f}}+{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e)),x)

[Out]

I*a*d*tan(f*x+e)/f+1/2*I/f*a*ln(1+tan(f*x+e)^2)*c+1/2/f*a*ln(1+tan(f*x+e)^2)*d-I/f*a*arctan(tan(f*x+e))*d+1/f*
a*arctan(tan(f*x+e))*c

________________________________________________________________________________________

Maxima [A]  time = 1.5285, size = 70, normalized size = 1.52 \begin{align*} -\frac{-2 i \, a d \tan \left (f x + e\right ) - 2 \,{\left (a c - i \, a d\right )}{\left (f x + e\right )} +{\left (-i \, a c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(-2*I*a*d*tan(f*x + e) - 2*(a*c - I*a*d)*(f*x + e) + (-I*a*c - a*d)*log(tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

Fricas [A]  time = 1.66419, size = 163, normalized size = 3.54 \begin{align*} -\frac{2 \, a d -{\left (-i \, a c - a d +{\left (-i \, a c - a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e)),x, algorithm="fricas")

[Out]

-(2*a*d - (-I*a*c - a*d + (-I*a*c - a*d)*e^(2*I*f*x + 2*I*e))*log(e^(2*I*f*x + 2*I*e) + 1))/(f*e^(2*I*f*x + 2*
I*e) + f)

________________________________________________________________________________________

Sympy [A]  time = 1.22202, size = 58, normalized size = 1.26 \begin{align*} - \frac{2 a d e^{- 2 i e}}{f \left (e^{2 i f x} + e^{- 2 i e}\right )} - \frac{a \left (i c + d\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e)),x)

[Out]

-2*a*d*exp(-2*I*e)/(f*(exp(2*I*f*x) + exp(-2*I*e))) - a*(I*c + d)*log(exp(2*I*f*x) + exp(-2*I*e))/f

________________________________________________________________________________________

Giac [B]  time = 1.31877, size = 149, normalized size = 3.24 \begin{align*} \frac{-i \, a c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - a d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - i \, a c \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - a d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, a d}{f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(c+d*tan(f*x+e)),x, algorithm="giac")

[Out]

(-I*a*c*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - a*d*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1
) - I*a*c*log(e^(2*I*f*x + 2*I*e) + 1) - a*d*log(e^(2*I*f*x + 2*I*e) + 1) - 2*a*d)/(f*e^(2*I*f*x + 2*I*e) + f)